Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of UB with uninitialized #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lucretiel
Copy link

@Lucretiel Lucretiel commented Oct 27, 2023

Remove uninitialized, which always produces UB when used with integers. We replace it with all zero bits, and trust that the compiler will trivially remove the unnecessary 0-initialization, since encode_utf8 is write-only.

Remove `uninitialized`, which always produces UB when used with integers
@Lucretiel
Copy link
Author

Closes #57

@jhand2
Copy link

jhand2 commented Dec 4, 2023

@japaric can this be merged? I believe it is an uncontroversial change and makes it easier to reason about the behavior of ufmt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants